<template>
  <div class="settings-container">
    <h2>设置</h2>
    <el-form :model="settingsForm" label-width="120px">
      <el-form-item label="主题">
        <el-radio-group v-model="settingsForm.theme">
          <el-radio label="light">浅色</el-radio>
          <el-radio label="dark">深色</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="语言">
        <el-select v-model="settingsForm.language">
          <el-option label="中文" value="zh-CN" />
          <el-option label="English" value="en-US" />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="saveSettings">保存设置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from "vue";
import { ElMessage } from "element-plus";

export default defineComponent({
  name: "SettingsPanel",
  setup() {
    const settingsForm = ref({
      theme: "light",
      language: "zh-CN",
    });

    const saveSettings = () => {
      ElMessage.success("设置已保存");
    };

    return {
      settingsForm,
      saveSettings,
    };
  },
});
</script>

<style lang="scss" scoped>
.settings-container {
  height: 100%;
  width: 100%;
  padding: 20px;
  background-color: #fff;
  overflow-y: auto;
}
</style>
